package net.rlair.sbdemo.entity;

import net.rlair.sbdemo.dao.mybatis.typehandler.SexConverter;
import net.rlair.sbdemo.dao.mybatis.typehandler.SexEnum;

import javax.persistence.*;
import java.util.Date;

/**
 * @author Administrator
 */
@Entity
@Table(name = "t_user")
public class User {
    private int id;
    private String name;
    private String password;
    private SexEnum sex;
    private Date created;
    private Date updated;

    @Id
    public int getId() {
        return id;
    }

    public void setId(final int id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(final String password) {
        this.password = password;
    }

    @Column(name = "sex")
    @Convert(converter = SexConverter.class)
    public SexEnum getSex() {
        return sex;
    }

    public void setSex(final SexEnum sex) {
        this.sex = sex;
    }

    @Column(name = "created")
    public Date getCreated() {
        return created;
    }

    public void setCreated(final Date created) {
        this.created = created;
    }

    @Column(name = "updated")
    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(final Date updated) {
        this.updated = updated;
    }

}

